1. Field of the Invention
This invention relates to the fields of graphics, image processing and object-oriented programming. More particularly, the invention relates to a method and apparatus for separating image data from an image's color system.
2. Background Art
In a computer system, a graphic image is typically comprised of a plurality of individual pixels. Each pixel is assigned a data value that defines the color of a pixel according to a particular color system associated with an image. A color system provides a mechanism for specifying color, and chromaticity, associated with each pixel in the graphic image. A color system consists of a set of components that specify a color in the color system. Each component is assigned a numeric value to express a color. For example, the RGB (Red, Green, Blue) color system consists of red, green and blue components. Three data values are used to express the degree of red, green and blue contributions for each color in the RGB color system. Images are either tightly coupled to a color system such that image data cannot be manipulated independent of the image's color system, or images are expressed independent of its color system until the image is rendered thereby making it impossible to manipulate an image in its color system.
Current software image processing applications or programs do not facilitate manipulation of an image based on the requirements of each particular image processing operation. That is, current systems either always associate the color system with image data or always disregard the color system during image processing. This causes inefficiencies in processing in that certain operations are more efficient when performed in terms of a color system while others are more efficient when the color system is ignored. Where the color system is not necessary for the image processing operation, it is wasted overhead. Further, where the color system is unavailable to an image processing operation that uses the color system, unexpected and erroneous results can occur.
Two examples of prior art software image processing systems are the Microsoft Windows and X11 windowing systems. In these systems, an image is defined in terms of an RGB color system which is used to interpret pixel data as color. It is impossible to create an image in these windowing systems without first identifying which portions of pixel data represent which component of the RGB color system.
In X11, for example, an image may be expressed in the RGB color system using 24-bit image data. That is, the color data for each pixel is stored in 24 bits with each component of the RGB color system being represented in 8 bits. To manipulate an image data in X11, it is first necessary to define which set of 8 bits represents which component of the color system. For example, the first 8 bits of the 24-bit value associated with a pixel may be assigned to the red component, the next 8 bits to the blue component and the last 8 bits to the green component. Similarly, an image may be expressed in terms of the RGB color system in Microsoft Windows. That is, the image data represents components in a color system. The image data in the X11 and Windows systems cannot be operated upon independent of the color system.
In XIL version 1.2 (a cross-platform C language image processing foundation library containing low-level image manipulation operators developed by Sun Microsystems, Inc.), a mechanism for associating a color system with image data as the image data is being processed is recognized by only one function (i.e., xil_color_convert). Thus, for all other operations, it is necessary for the developer to be aware of what operation is being performed and the effect that the operation has on the image's color system. There is no general way, for example, for the developer to guarantee the effect that an operation will have on a component of the image's color system since the operation has no knowledge of the associations between the image data and components of a color system. In XIL version 1.3, a new mechanism to represent a color system is supported, but the color system data is maintained separately from the image data at all times.
Thus, in prior art image processing systems, the color system is either always tightly coupled to an image, or is always disassociated from the image during image processing operations. This is problematic in that some operations that are to be performed on an image use the color system while other image processing operations can be performed independent of the color system. Prior art systems have no mechanism for processing an image such that it is possible to reference the image in terms of or independent of its color system based on the requirements of the image processing operation.
There is nothing apparent in a particular image operation that indicates whether it operates on input that is tied to the color system. Thus, the developer of an image processing application must be aware of which image processing operations use the color system (e.g., a color conversion) and which operations do not (e.g., rotation). Further, certain operations may be performed more efficiently with a particular color system. Therefore, there are inefficiencies in forcing the developer into a particular color system to process an image. However, as previously discussed, there are drawbacks to having a system in which the image is processed using operations that do not take the color system into account.
In summary, current software image processing applications either tightly couple the color system with the image or disregard the color system during image processing. This causes inefficiencies in processing and causes erroneous results.